import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { PrismaService } from './middleware/prisma/prisma.service';
import { PrismaModule } from './middleware/prisma/prisma.module';
import { UserModule } from './views/user/user.module';
import { RedisModule } from './middleware/redis/redis.module';
import { EmailModule } from './middleware/email/email.module';
import { SvgModule } from './middleware/svg/svg.module';
import { JwtsModule } from './middleware/jwt/jwt.module';
import { APP_GUARD } from '@nestjs/core';
import { AuthGuard } from './middleware/auth/auth.guard';
import { CommonModule } from './views/common/common.module';
import { MinioModule } from './middleware/minio/minio.module';
import { WinstonsModule } from './middleware/winston/winston.module';
import { ConfigModule } from '@nestjs/config';
import { InformModule } from './views/inform/inform.module';

@Module({
  imports: [
    PrismaModule,
    RedisModule,
    EmailModule,
    SvgModule,
    JwtsModule,
    MinioModule,
    CommonModule,
    UserModule,
    WinstonsModule,
    ConfigModule.forRoot({
      isGlobal: true,
      envFilePath: 'src/.env',
    }),
    InformModule,
  ],
  controllers: [AppController],
  providers: [
    AppService,
    PrismaService,
    {
      provide: APP_GUARD,
      useClass: AuthGuard,
    },
  ],
})
export class AppModule {}
